<div id="header">
    <div id="sub_header">
        <div id="menu">
            <ul id="first_menu">
                <li>
                    <a href="index.php" id="xahoi">
                        Trang chủ
                    </a>
                </li>
                <li>
                    <a href="index.php" id="xahoi">
                        Trợ giúp
                    </a>
                </li>
                <li>
                    <a href="index.php" id="xahoi">
                        Giới thiệu
                    </a>
                </li>
                <?php if (Yii::app()->user->isGuest) { ?>
                    <li>
                        <a href="index.php?r=site/register" id="xahoi">
                            Đăng kí
                        </a>
                    </li>
            </ul> 
           
            <!--search box
            <search>
                <form action="/search/" method="post">
                    <input style="border:1px solid #ccc;" name="keywords" id="keywords" type="text" size="40" placeholder="Search..." />
                    <input type="submit"class="submit_btn" value="">
                </form>
            </search>
            -->
            
              <?php } ?>
                    
                <?php if (Yii::app()->user->isGuest) { ?>
                <div class = "login">
                    <div class="account_icon"></div>


                    <div class="form">
                        <?php
                        $form = $this->beginWidget('CActiveForm', array(
                            'id' => 'login-form',
                            'action' => array("site/login"),
                            'method' => 'post',
                            'enableClientValidation' => true,
                            'clientOptions' => array(
                                'validateOnSubmit' => true,
                            ),
                                ));
                        ?>
                        <div class ="input-user">
                            <?php echo $form->textField($login_form, 'username'); ?>
                            <?php echo $form->error($login_form, 'username'); ?>
                        </div>

                        <div class ="input-pass">
                            <?php echo $form->passwordField($login_form, 'password'); ?>
                            <?php echo $form->error($login_form, 'password'); ?>
                        </div>
                        <div class="btn-login">
                            <?php echo CHtml::submitButton('Login'); ?>
                        </div>
                     <?php $this->endWidget(); ?>
                        
                        <div class="signup">
                            <?php echo $form->checkBox($login_form, 'rememberMe'); ?>
                            <?php echo $form->label($login_form, 'rememberMe'); ?>
                            <?php echo $form->error($login_form, 'rememberMe'); ?>
                        </div>
                        <div class="signup">
                            <a href="#">Forgot password</a>
                        </div>	
                       
                    </div><!-- form -->  
                </div>
            <?php } else { ?>
                <div class="welcome">
                    Welcome <?php echo Yii::app()->user->getName(); ?>
                    <a href="index.php?r=site/logout">Logout</a>
                </div>
            <?php } ?>   
        </div>

    </div>
</div><!--  end header -->
